package com.CST.config;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

/**
 * @Description:获得应用上下文,来获得Bean对象
 * @Author: wzw
 * @Time: 2020/8/18 9:05
 */
@Component
public class ApplicationContextGetter implements ApplicationContextAware {

    private static ApplicationContext ac;

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
	  ac = applicationContext;
    }

    public static ApplicationContext getAc() {
	  return ac;
    }
}
